package cn.stylefeng.guns.modular.hx.dps.controller;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.hx.dps.entity.DpsZcServer;
import cn.stylefeng.guns.modular.hx.dps.model.params.DpsZcServerParam;
import cn.stylefeng.guns.modular.hx.dps.service.DpsZcServerService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import cn.stylefeng.guns.sys.modular.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * 综成对接库控制器
 *
 * @author zhangzh
 * @Date 2025-10-11 13:01:33
 */
@Controller
@RequestMapping("/dpsZcServer")
public class DpsZcServerController extends BaseController {

    private String PREFIX = "/dpsZcServer";

    @Autowired
    private DpsZcServerService dpsZcServerService;

    @Autowired
    private UserService userService;

    /**
     * 跳转到主页面
     *
     * @author zhangzh
     * @Date 2025-10-11
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "/dpsZcServer.html";
    }

    /**
     * 新增页面
     *
     * @author zhangzh
     * @Date 2025-10-11
     */
    @RequestMapping("/add")
    public String add() {
        return PREFIX + "/dpsZcServer_add.html";
    }

    /**
     * 编辑页面
     *
     * @author zhangzh
     * @Date 2025-10-11
     */
    @RequestMapping("/edit")
    public String edit() {
        return PREFIX + "/dpsZcServer_edit.html";
    }

    /**
     * 新增接口
     *
     * @author zhangzh
     * @Date 2025-10-11
     */
    @RequestMapping("/addItem")
    @ResponseBody
    public ResponseData addItem(DpsZcServerParam dpsZcServerParam) {
        this.dpsZcServerService.add(dpsZcServerParam);
        return ResponseData.success();
    }

    /**
     * 编辑接口
     *
     * @author zhangzh
     * @Date 2025-10-11
     */
    @RequestMapping("/editItem")
    @ResponseBody
    public ResponseData editItem(DpsZcServerParam dpsZcServerParam) {
        this.dpsZcServerService.update(dpsZcServerParam);
        return ResponseData.success();
    }

    /**
     * 删除接口
     *
     * @author zhangzh
     * @Date 2025-10-11
     */
    @RequestMapping("/delete")
    @ResponseBody
    public ResponseData delete(DpsZcServerParam dpsZcServerParam) {
        this.dpsZcServerService.delete(dpsZcServerParam);
        return ResponseData.success();
    }

    /**
     * 查看详情接口
     *
     * @author zhangzh
     * @Date 2025-10-11
     */
    @RequestMapping("/detail")
    @ResponseBody
    public ResponseData detail(DpsZcServerParam dpsZcServerParam) {
        DpsZcServer detail = this.dpsZcServerService.getById(dpsZcServerParam.getId());
        return ResponseData.success(detail);
    }

    /**
     * 查询列表
     *
     * @author zhangzh
     * @Date 2025-10-11
     */
    @ResponseBody
    @RequestMapping("/list")
    public LayuiPageInfo list(DpsZcServerParam dpsZcServerParam,String condition ) {
        return this.dpsZcServerService.findPageBySpec(dpsZcServerParam,condition);
    }

}


